<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
<head>
    <title>电影列表</title>
    <style>
        /* CSS样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f1f1f1;
            margin: 0;
            padding: 20px;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
        }

        h1 {
            text-align: center;
        }

        .movie-list {
            list-style-type: none;
            padding: 0;
        }

        .movie-item {
            background-color: #fff;
            padding: 10px;
            margin-bottom: 10px;
        }

        .movie-item .title {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .movie-item .description {
            font-size: 14px;
            color: #555;
        }

        .pagination {
            margin-top: 20px;
            text-align: center;
        }

        .pagination ul {
            list-style-type: none;
            padding: 0;
            display: inline-block;
        }

        .pagination li {
            display: inline-block;
        }

        .pagination a {
            padding: 8px;
            text-decoration: none;
            color: #333;
        }

        .pagination a:hover {
            background-color: #eee;
        }

        .pagination .active a {
            background-color: #4CAF50;
            color: white;
        }

        .pagination .disabled a {
            pointer-events: none;
            background-color: #ddd;
            color: #999;
        }
    </style>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script>
        function push(id) {
            console.log(id);
            $.ajax({
                type: "GET",
                url: "/ods-movie-info/send",
                data: {id: id},
                dataType: "JSON",
                success: function (result) {
                    console.log(result.msg)
                    alert(result.msg);
                }
            });
        }
    </script>
</head>
<body>
<div class="container">
    <h1>电影列表</h1>
    <ul class="movie-list">
        <li class="movie-item" th:each="movie,userStat:${odsMovieInfoList}">
            <div class="title" th:text="${movie.title}"></div>
            <div class="description" th:text="|类型:${movie.tags}|"></div>
            <div class="description" th:text="|上映时间:${movie.onlineTime}|"></div>
            <button onclick="push(this.getAttribute('data-item'))" th:attr="data-item=${movie.id}">推送</button>
        </li>
        <!-- 添加更多电影项 -->
    </ul>

    <div class="pagination">
        <ul>
            <li th:if="${page.hasPrevious()}">
                <a th:href="@{|/ods-movie-info/admin?pageNum=${page.current-1}|}">上一页</a>
            </li>
            <li th:if="${page.hasNext()}">
                <a th:href="@{|/ods-movie-info/admin?pageNum=${page.current+1}|}">下一页</a>
            </li>
        </ul>
    </div>

</div>
</body>
</html>